#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
	bool containsNearbyDuplicate(vector<int>& nums, int k) {
		for (int i = 0; i < nums.size(); i++) {
			for (int j = i; j <= i+k&&j<nums.size(); j++) {
				if (nums[i] == nums[j]) {
					return true;
				}
			}
		}
		return false;
	}
};
int main() {
	Solution s;
	vector<int> a = { 2,6,4,1 };

}